package exception;

public class FinalExcDemo {
    public static void main(String[] args) {
        String str=null;
        //str="a";
        System.out.println("程序执行");
        try {
            System.out.println("try---");
            str.length();
            System.out.println("异常");
            return;
        }catch (NullPointerException e) {
            System.out.println("捕获异常，补救措施");
        }finally {
            //不论 有无异常，finally都会执行的
            // try 中 return finally依然会执行
            System.out.println("finally---");
        }
        System.out.println("程序运行结束");



    }
}
